<style>
page{
	 background: #fafafa;
}
.g-tab-box{
	height: 72upx;
	line-height: 72upx;
	width: 100%;
	border-bottom: 2upx solid #f5f5f5;
}
.m-tab-title{
	width: 33%;
	text-align: center;
	font-size: 30upx;
	float: left;
}
.u-tab-act{
	width: 54upx;
	height: 5upx;
	background: #d71611;
	margin: 0 auto;
	position: relative;
    top: -2.8upx;
}
.m-list-view{
	height: 100%;
	width: 100%;
	overflow: hidden;
}
.m-item{
	width: 100%;
	height: 160upx;
	border-bottom: 1px solid #dcdcdc;
	display: flex;
	align-items: center;
	padding: 20upx;
}
.m-row{
	width: 695upx;
	margin: 0 auto;
	margin-top: 30upx;
}
.m-item image{
	width: 122upx;
	height: 122upx;
}
.m-row-user{
	margin-left: 31upx;
}
.u-username{
	font-size: 30upx;
}
.u-last-login{
	font-size: 26upx;
	color: #9c9c9c;
	margin-top: 10upx;
}
.m-row-user .color{
	color: #828080;
}
</style>

<template>
	<view class="m-list-view">
		<view class="m-item" v-for="(item,index) in data" :key="index">
			<image :src="item.head_pic"></image>
			<view class="m-row-user">
				<view class="u-username">{{item.alias}}</view>
				<view class="u-last-login">最近登录：{{item.last_time}}</view>
			</view>
		</view>
		<mix-load-more :status="loadMoreStatus"></mix-load-more>
	</view>
</template>
<script>
    import jewel from '@/common/common_zb.js';
	
	export default {
		data() {
			return {
                page: 1,
                data: [],
				total_pages: 1,
				loadMoreStatus:1
			};
		},
        methods: {
			getData(type){
				let that = this
				if(that.page <= that.total_pages){
					jewel.get('member/getChildrenMember',{page:that.page},true,function(res){
						if(type == 'loadMore'){
							that.data = that.data.concat(res.data.data)
						}else{
							// uni.setNavigationBarTitle({
							// 	title: '好友列表（' + res.data.count + '）'
							// })
							that.data = res.data.data
							that.total_pages = res.data.total_pages
							that.loadMoreStatus = that.total_pages <= 1 ? 2:0
						}
					})
				}else{
					that.loadMoreStatus = 2
				}
			}
        },
        onLoad() {
            this.getData();
        },
        onReachBottom() {
            this.page++
            this.getData('loadMore')
        }
	}
</script>

